{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "ae5b9e73",
   "metadata": {},
   "source": [
    "# Installation\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "3724ac29",
   "metadata": {},
   "source": [
    "## Clone the code\n",
    "\n",
    "```sh\n",
    "git clone https://github.com/interpretml/interpret.git\n",
    "```\n",
    "\n",
    "## (Optional) Create a conda environment and activate it\n",
    "\n",
    "```sh\n",
    "conda create --name ENV_NAME python=3.7\n",
    "\n",
    "conda activate ENV_NAME\n",
    "```\n",
    "## Install `interpret` with every dependency\n",
    "\n",
    "```sh\n",
    "cd interpret/scripts\n",
    "\n",
    "make install\n",
    "\n",
    "cd ../python/interpret-core\n",
    "\n",
    "pip install -e .[required,debug,notebook,plotly,lime,sensitivity,shap,ebm,linear,decisiontree,treeinterpreter,dash,skoperules,testing]\n",
    "\n",
    "```"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "f170aaaf",
   "metadata": {},
   "source": [
    "## Run Unit Tests\n",
    "\n",
    "```sh\n",
    "cd interpret/scripts\n",
    "\n",
    "make test\n",
    "```\n",
    "\n",
    "It is also possible to run the specific unit tests for Native code / Python:\n",
    "\n",
    "````{tab-set}\n",
    "```{tab-item} Native (C++)\n",
    "Build and run `interpret/shared/ebm_native/ebm_native_test`\n",
    "```\n",
    "```{tab-item} Python\n",
    "cd interpret/python/interpret-core\n",
    "\n",
    "python -m pytest\n",
    "\n",
    "----------------------------------------------\n",
    "\n",
    "To run all tests add the parameter `--runslow`\n",
    "\n",
    "python -m pytest --runslow\n",
    "```\n",
    "```{tab-item} Python in VS Code\n",
    "1. Install the _Text Explorer UI_ extension\n",
    "\n",
    "2. Open the Command Palette (e.g. press F1)\n",
    "\n",
    "3. (Optional) If a conda environment is being used choose _Python: Select Interpreter_ and select the correct environment\n",
    "\n",
    "4. Choose _Python: Configure Tests_ and select _pytest_\n",
    "\n",
    "5. Select the root folder as ```interpret/python```\n",
    "\n",
    "6. Once you have chosen the test framework, you should be able to open the Test Explorer Extension and run all Python unit tests\n",
    "\n",
    "   - To see the output of a test go to the _Output Window_ --> _Python Test Log_\n",
    "   - Some tests depend on C++ code, so it should be installed\n",
    "```\n",
    "````"
   ]
  }
 ],
 "metadata": {
  "language_info": {
   "name": "python"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
